AS=/usr/local/mips-cross/bin/mipsel-elf-as
CC=/usr/local/mips-cross/bin/mipsel-elf-gcc
LD=/usr/local/mips-cross/bin/mipsel-elf-ld
OBJCOPY=/usr/local/mips-cross/bin/mipsel-elf-objcopy
OBJDUMP=/usr/local/mips-cross/bin/mipsel-elf-objdump

all:
	$(AS) -mips1 shift.S -o shift.o -EL 
	$(LD) -mips1 -T ../../lib/default.ld shift.o -o shift.elf -EL
	$(OBJCOPY) -j .startup.bootvec -j .startup -O binary shift.elf shift.bin
	hexdump -e "1/4 \"%08x\n\"" shift.bin -v > shift.hex
	cat ../../lib/nops.hex >> shift.hex
	
dump:
	$(OBJDUMP) -j .startup.bootvec -j .startup -D shift.elf

symbols:
	$(OBJDUMP) -t shift.elf

sections:
	$(OBJDUMP) -h shift.elf

clean:
	rm -f shift.bin shift.elf shift.hex shift.o
